<style>
#reportKomercijalaForm{
	width:300px;
}
#reportKomercijalaForm label{
	display:block;
	float:left;
	padding-top:8px;
	text-align:right;
}
#reportKomercijalaForm legend{color:#aaa}
#reportKomercijalaForm fieldset{border:1px solid #aaa}

#reportKomercijalaForm input[type=submit]{
	float:right;
}
#reportKomercijalaForm select optgroup{
	background:Highlight;
	color:HighlightText;
	font-size:14px;
	font-style:normal;
}
#reportKomercijalaForm select optgroup option{
	background:#fff;
	color:#000;
	font-size:11px;
}
#reportKomercijalaForm input.searchBtn{
	width:20px;
	height:20px;
	border:none;
	cursor:pointer;
	background:url(gui/icons/search.gif) no-repeat center center;
	margin-left:0px;
}
#reportKomercijalaForm input.clearKomitent{
	width:20px;
	height:20px;
	margin-left:0px;
	border:none;
	cursor:pointer;
	background:url(gui/icons/delete.gif) no-repeat center center;
}
#reportKomercijalaForm legend select{
	float:none;
	margin:0px;
}
#reportKomercijalaForm_main{
	width:700px;
	max-height:500px;
	overflow:auto;
	margin-left:3px;
	font-size:11px;
}
#reportKomercijalaForm_main table{
	width:100%;
	border-top:1px solid #aaa;
	border-left:1px solid #aaa;
}
#reportKomercijalaForm_main table tr{
	cursor:pointer;
}
#reportKomercijalaForm_main table tr.ima{
	background-image:url(gui/icons/ok.gif);
	background-repeat:no-repeat;
	background-position:2px 90%;
}
#reportKomercijalaForm_main table tr.head:hover,
#reportKomercijalaForm_main table tr.head{
	background-color:#2577BA;
	color:#fff;
	font-weight:bolder;
	cursor:default;
}
#reportKomercijalaForm_main table tr.head td{
	vertical-align:middle;
	text-align:center;
}
#reportKomercijalaForm_main table tr:hover{
	background-color:#2577BA;
	color:#fff;
}
#reportKomercijalaForm_main table tr td{
	border-right:1px solid #aaa;
	border-bottom:1px solid #aaa;
	padding:2px 4px;
	vertical-align:top;
}
#reportKomercijalaForm_main table tr td a img{
	border:none;
}
#reportKomercijalaForm_main table tr:hover td a img{
	border:1px solid #fff;
}
#reportKomercijalaForm_info{
	width:310px;
	clear:both;
	color:#848263;
	font-weight:bolder;
	font-size:11px;
	padding:2px 5px;
	text-align:right;
	margin-top:-1px;
}
#rokovnikMoreInfo{
	width:310px;
	clear:both;
	padding:5px;
	margin-top:-1px;
}
#rokovnikMoreInfo strong{
	display:block;
	padding:2px 2px 2px 7px;
	text-transform:uppercase;
	background:url(gui/head_gradient.gif) no-repeat 0px 0px;
	color:#fff;
}
#rokovnikMoreInfo ul{
	margin:0px 0px 10px 0px;
	padding:5px 0px 0px 25px;
	list-style-type:square;
}
#rokovnikMoreInfo ul li{
	margin:0px;
	padding:2px;
}
</style>
<div style="float:left">
	<form id="reportKomercijalaForm" class="area" method="post" action="javascript:void(0)" onsubmit="rokovnikReport(this)">
		<h1>Izveštaj distribucije</h1>
		<input type="hidden" name="a" value="report" />
		<input type="hidden" name="t" value="kom" />
		<fieldset>
		  <legend>Filter:</legend>
			<label for="datum">Datum posete:</label>
			<input class="dateInput" type="text" name="datum" id="datum" value="{{$filter_datum}}" />
			<input type="button" class="datePicker" onclick="displayDatePicker('datum',this)" />
			<input class="dateInput" type="text" name="datum0" id="datum0" value="{{$filter_datum_end}}" />
			<input type="button" class="datePicker" onclick="displayDatePicker('datum0',this)" />
			<br clear="all" />
			<label for="datum1">Datum unosa:</label>
			<input class="dateInput" type="text" name="datum1" id="datum1" value="{{$filter_datum1}}" />
			<input type="button" class="datePicker" onclick="displayDatePicker('datum1',this)" />
			<input class="dateInput" type="text" name="datum10" id="datum10" value="{{$filter_datum1_end}}" />
			<input type="button" class="datePicker" onclick="displayDatePicker('datum10',this)" />
			<br clear="all" />
			<label for="komitent">Komitent:</label>
			<input type="text" disabled="disabled" name="komitent" id="komitent" value="{{$filter_komitent}}" />
			<input type="hidden" name="komitent_id" id="komitent_id" value="{{$filter_komitent_id}}" />
			<input type="button" onclick="selectKomitent('komitent','komitent_id')" title="Nađi komitenta..." value="" class="searchBtn" />
			<input type="button" class="clearKomitent" value="" onclick="document.getElementById('komitent').value=''; document.getElementById('komitent_id').value='';" />
			<br clear="all" />
			<fieldset>
				<legend>Teritorija:</legend>
				<label for="tt">Naziv:</label>
				<select name="tt" id="tt" onchange="showTeritorijaDates(this)" style="width:180px;">
					<option value="0">---</option>
					{{%loop start tn}}
					<option ids="{{$ti}}" dates="{{$td}}" {{$ts}}>{{$tn}}</option>
					{{%loop end}}
				</select>
				<br clear="all" />
				<label for="td">Datum:</label>
				<select name="td" id="td" onchange="updateTeritorije(this)">
					<option value="-1">---</option>
					{{$tds}}
				</select>
				<input type="hidden" name="teritorije" id="teritorije" value="{{$filter_tids}}" />
			</fieldset>
			<br clear="all" />
			<label for="radnik">Operater:</label>
			<select name="radnik" id="radnik">
				<option value="0">---</option>
				{{%loop start radnik_id}}
				<option value="{{$radnik_id}}" title="{{$radnik_user}}" {{$radnik_selected}}>{{$radnik_ime}}&nbsp;{{$radnik_prezime}}</option>
				{{%loop end}}
			</select><br clear="all" />
			<label for="poreklo">Poreklo:</label>
			<select name="poreklo" id="poreklo">
				<option value="0">---</option>
				{{%loop start poreklo_id}}
				<option value="{{$poreklo_id}}" {{$poreklo_selected}}>{{$poreklo_name}}</option>
				{{%loop end}}
			</select><br clear="all" />
			<fieldset>
				<legend>
					Telemarketing kontakt:
					<select name="kontaktiran" id="kontaktiran">
						<option value="0">---</option>
						<option value="1" {{$selected_nekontaktiran}}>NE</option>
						<option value="2" {{$selected_kontaktiran}}>DA</option>
					</select>
				</legend>
				<label for="kontaktiran_date_start">od:</label>
				<input type="text" class="dateInput" name="kontaktiran_date_start" id="kontaktiran_date_start" value="{{$filter_kd_start}}" />
				<input type="button" class="datePicker" onclick="displayDatePicker('kontaktiran_date_start',this)" />
				<label for="kontaktiran_date_end">do:</label>
				<input type="text" class="dateInput" name="kontaktiran_date_end" id="kontaktiran_date_end" value="{{$filter_kd_end}}" />
				<input type="button" class="datePicker" onclick="displayDatePicker('kontaktiran_date_end',this)" />
				
				<br clear="all" />
				
				<label for="kontaktiran_sastanak">sastanak:</label>
				<select name="kontaktiran_sastanak" id="kontaktiran_sastanak">
					<option value="0">---</option>
					<option value="1" {{$filter_ks_da}}>DA</option>
					<option value="2" {{$filter_ks_ne}}>NE</option>
				</select>
				
			</fieldset>
			<br clear="all" />
			<input type="submit" value="filter" />
		</fieldset>
	</form><br clear="all" />
	<div id="reportKomercijalaForm_info" class="area">{{$info}}</div>
	<div id="rokovnikMoreInfo" class="area"></div>
</div>
<div style="float:left">
	<div class="area" id="reportKomercijalaForm_main">
		{{$start_comment}}
		<input type="button" class="excel" value="nekontaktirani komitenti" onclick="exportNepozvaniKomitenti(this);" />
		<table style="clear:both">
			<tr class="head">
				<td>#</td>
				<td>komitent</td>
				<td>adresa</td>
				<td>radnik</td>
				<td>operater</td>
				<td>teritorija</td>
				<td>poseta</td>
				<td>unos</td>
				<td>zovi</td>
				<td>poreklo</td>
				<td>odgovor</td>
				<td>napomena</td>
			</tr>
			{{%loop start id}}
			<tr class="{{$ima}}" id="{{$id}}" onclick="showMoreInfo('{{$komitent_id}}',this)" title="kliknite za detalje o delatnostima i adresama..">
				<td>{{$komitent_id}}</td>
				<td>{{$komitent}}</td>
				<td>{{$adresa}}</td>
				<td>{{$radnik}}</td>
				<td>{{$operater_ime}}&nbsp;{{$operater_prezime}}</td>
				<td title="{{$teritorija_desc}}">{{$teritorija}}</td>
				<td>{{$poseta}}</td>
				<td>{{$unos}}</td>
				<td>{{$zovi}}</td>
				<td>{{$poreklo}}</td>
				<td>{{$odgovor}}</td>
				<td>{{$napomena}}</td>
			</tr>
			{{%loop end}}
		</table>
		{{$end_comment}}
		{{$message}}
	</div>
</div>